<div class="container">
  <div class="module-title">新建/编辑部门信息</div>
  <form class="form-content" nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
    <nz-form-item>
      <nz-form-label [nzSpan]="7" nzRequired>名称</nz-form-label>
      <nz-form-control [nzSpan]="12" nzErrorTip="请输入名称">
        <input nz-input formControlName="name" [(ngModel)]="departmentInfo.name" placeholder="请输入名称" />
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSpan]="7" nzRequired>部门类别</nz-form-label>
      <nz-form-control [nzSpan]="12" nzErrorTip="请输入部门类别">
        <nz-select [(ngModel)]="departmentInfo.depType" formControlName="depType" placeholder="请输入部门类别" nzAllowClear>
          <nz-option nzValue="行政部门" nzLabel="行政部门"></nz-option>
          <nz-option nzValue="审核部门" nzLabel="审核部门"></nz-option>
        </nz-select>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSpan]="7">负责人</nz-form-label>
      <nz-form-control [nzSpan]="12">
        <nz-select placeholder="请输入负责人" formControlName="leaderPerson" [(ngModel)]="departmentInfo.leaderPerson">
          <nz-option *ngFor="let option of UserList" [nzLabel]="option.nodeName" [nzValue]="option.objectId">
          </nz-option>
        </nz-select>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSpan]="7">描述</nz-form-label>
      <nz-form-control [nzSpan]="12">
        <input nz-input formControlName="description" [(ngModel)]="departmentInfo.description" placeholder="请输入描述" />
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-label [nzSpan]="7" nzRequired>上级部门</nz-form-label>
      <nz-form-control [nzSpan]="12" nzErrorTip="请输入上级部门">
        <nz-select nzShowSearch nzAllowClear nzPlaceHolder="请输入上级部门" formControlName="parentId"
          [(ngModel)]="departmentInfo.parentId">

          <ng-container *ngFor="let option of departmentList">
            <nz-option *ngIf="option.objectId != notequId" [nzLabel]="option.nodeName" [nzValue]="option.id">
            </nz-option>
          </ng-container>
        </nz-select>
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>
      <nz-form-control [nzOffset]="7" [nzSpan]="12">
        <button nz-button (click)="goBack()" nzSize="large">取消</button>
        <button nz-button nzType="primary" class="ml20" nzSize="large" type="submit" (click)="confirm()">确定</button>
      </nz-form-control>
    </nz-form-item>
  </form>
</div>